package com.example.hybridmobiledemo.module.main.model.hospital;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.OrientationHelper;
import androidx.recyclerview.widget.RecyclerView;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.example.hybridmobiledemo.R;
import com.example.hybridmobiledemo.module.main.model.hospital.bean.Doctor;
import com.example.hybridmobiledemo.view.DoctorAdapter;

import java.util.ArrayList;
import java.util.List;

public class RecommendDoctor extends AppCompatActivity {

    private TextView backDoctor;
    private RecyclerView doctorRV;
    private List<Doctor> list = new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_recommend_doctor);
        initView();
        initData();
        backDoctor.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });


    }

    private void initData() {
        for (int i = 0; i < 8; i++) {
            list.add(new Doctor("张三","擅长用毫针，耳针，腹针，皮肤针，放血疗法，耳豆压穴等治疗常见病。"));
        }
    }

    @SuppressLint("WrongConstant")
    private void initView() {
        backDoctor = (TextView) findViewById(R.id.back_doctor);
        doctorRV = (RecyclerView) findViewById(R.id.doctor_RV);
        doctorRV.setAdapter(new DoctorAdapter(list,this));
        doctorRV.setLayoutManager(new LinearLayoutManager(this, OrientationHelper.VERTICAL,false));
    }
}